package com.cskaoyan.controller;

import com.cskaoyan.bean.vo.BaseRespVo;
import com.cskaoyan.service.FeedbackService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/admin/feedback")
public class FeedBackController {
    @Autowired
    FeedbackService feedbackService;

    @RequiresPermissions("admin:feedback:list")
    @GetMapping("/list")
    public Object list(
            Integer userId,
            String username,
            Integer page,
            Integer limit,
            String sort,
            String order
    ){
        Map<String, Object> map = feedbackService.querySelective(userId, username, page, limit, sort, order);
        return BaseRespVo.success(map);
    }
}
